Optimal. Leaf size=106 \[ \frac {1}{4} \sqrt {3} \log \left (x^2-\sqrt {3} \sqrt {x^2+1}+2\right )-\frac {1}{4} \sqrt {3} \log \left (x^2+\sqrt {3} \sqrt {x^2+1}+2\right )-\frac {1}{2} \tan ^{-1}\left (\sqrt {3}-2 \sqrt {x^2+1}\right )+\frac {1}{2} \tan ^{-1}\left (2 \sqrt {x^2+1}+\sqrt {3}\right ) \]
________________________________________________________________________________________
Rubi [A] time = 0.13, antiderivative size = 106, normalized size of antiderivative = 1.00, number of steps used = 11, number of rules used = 7, integrand size = 28, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.250, Rules used = {1685, 826, 1169, 634, 618, 204, 628} \begin {gather*} \frac {1}{4} \sqrt {3} \log \left (x^2-\sqrt {3} \sqrt {x^2+1}+2\right )-\frac {1}{4} \sqrt {3} \log \left (x^2+\sqrt {3} \sqrt {x^2+1}+2\right )-\frac {1}{2} \tan ^{-1}\left (\sqrt {3}-2 \sqrt {x^2+1}\right )+\frac {1}{2} \tan ^{-1}\left (2 \sqrt {x^2+1}+\sqrt {3}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 204
Rule 618
Rule 628
Rule 634
Rule 826
Rule 1169
Rule 1685
Rubi steps
\begin {align*} \int \frac {x \left (1+2 x^2\right )}{\sqrt {1+x^2} \left (1+x^2+x^4\right )} \, dx &=\frac {1}{2} \operatorname {Subst}\left (\int \frac {1+2 x}{\sqrt {1+x} \left (1+x+x^2\right )} \, dx,x,x^2\right )\\ &=\operatorname {Subst}\left (\int \frac {-1+2 x^2}{1-x^2+x^4} \, dx,x,\sqrt {1+x^2}\right )\\ &=\frac {\operatorname {Subst}\left (\int \frac {-\sqrt {3}+3 x}{1-\sqrt {3} x+x^2} \, dx,x,\sqrt {1+x^2}\right )}{2 \sqrt {3}}+\frac {\operatorname {Subst}\left (\int \frac {-\sqrt {3}-3 x}{1+\sqrt {3} x+x^2} \, dx,x,\sqrt {1+x^2}\right )}{2 \sqrt {3}}\\ &=\frac {1}{4} \operatorname {Subst}\left (\int \frac {1}{1-\sqrt {3} x+x^2} \, dx,x,\sqrt {1+x^2}\right )+\frac {1}{4} \operatorname {Subst}\left (\int \frac {1}{1+\sqrt {3} x+x^2} \, dx,x,\sqrt {1+x^2}\right )+\frac {1}{4} \sqrt {3} \operatorname {Subst}\left (\int \frac {-\sqrt {3}+2 x}{1-\sqrt {3} x+x^2} \, dx,x,\sqrt {1+x^2}\right )-\frac {1}{4} \sqrt {3} \operatorname {Subst}\left (\int \frac {\sqrt {3}+2 x}{1+\sqrt {3} x+x^2} \, dx,x,\sqrt {1+x^2}\right )\\ &=\frac {1}{4} \sqrt {3} \log \left (2+x^2-\sqrt {3} \sqrt {1+x^2}\right )-\frac {1}{4} \sqrt {3} \log \left (2+x^2+\sqrt {3} \sqrt {1+x^2}\right )-\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,-\sqrt {3}+2 \sqrt {1+x^2}\right )-\frac {1}{2} \operatorname {Subst}\left (\int \frac {1}{-1-x^2} \, dx,x,\sqrt {3}+2 \sqrt {1+x^2}\right )\\ &=-\frac {1}{2} \tan ^{-1}\left (\sqrt {3}-2 \sqrt {1+x^2}\right )+\frac {1}{2} \tan ^{-1}\left (\sqrt {3}+2 \sqrt {1+x^2}\right )+\frac {1}{4} \sqrt {3} \log \left (2+x^2-\sqrt {3} \sqrt {1+x^2}\right )-\frac {1}{4} \sqrt {3} \log \left (2+x^2+\sqrt {3} \sqrt {1+x^2}\right )\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] time = 0.20, size = 125, normalized size = 1.18 \begin {gather*} \frac {\sqrt {2 \left (1-i \sqrt {3}\right )} \tanh ^{-1}\left (\frac {\sqrt {2} \sqrt {x^2+1}}{\sqrt {1-i \sqrt {3}}}\right )}{-1+i \sqrt {3}}+\frac {\sqrt {2 \left (1+i \sqrt {3}\right )} \tanh ^{-1}\left (\frac {\sqrt {2} \sqrt {x^2+1}}{\sqrt {1+i \sqrt {3}}}\right )}{-1-i \sqrt {3}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
IntegrateAlgebraic [C] time = 0.13, size = 81, normalized size = 0.76 \begin {gather*} \frac {1}{2} \left (1-i \sqrt {3}\right ) \tan ^{-1}\left (\frac {1}{2} \left (1-i \sqrt {3}\right ) \sqrt {x^2+1}\right )+\frac {1}{2} \left (1+i \sqrt {3}\right ) \tan ^{-1}\left (\frac {1}{2} \left (1+i \sqrt {3}\right ) \sqrt {x^2+1}\right ) \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [B] time = 1.19, size = 279, normalized size = 2.63 \begin {gather*} \frac {1}{4} \, \sqrt {3} \log \left (32 \, x^{4} + 80 \, x^{2} + 32 \, \sqrt {3} {\left (x^{3} + x\right )} - 16 \, {\left (2 \, x^{3} + \sqrt {3} {\left (2 \, x^{2} + 1\right )} + 4 \, x\right )} \sqrt {x^{2} + 1} + 32\right ) - \frac {1}{4} \, \sqrt {3} \log \left (32 \, x^{4} + 80 \, x^{2} - 32 \, \sqrt {3} {\left (x^{3} + x\right )} - 16 \, {\left (2 \, x^{3} - \sqrt {3} {\left (2 \, x^{2} + 1\right )} + 4 \, x\right )} \sqrt {x^{2} + 1} + 32\right ) - \arctan \left (2 \, \sqrt {2 \, x^{4} + 5 \, x^{2} + 2 \, \sqrt {3} {\left (x^{3} + x\right )} - {\left (2 \, x^{3} + \sqrt {3} {\left (2 \, x^{2} + 1\right )} + 4 \, x\right )} \sqrt {x^{2} + 1} + 2} {\left (x + \sqrt {x^{2} + 1}\right )} + \sqrt {3} - 2 \, \sqrt {x^{2} + 1}\right ) - \arctan \left (2 \, \sqrt {2 \, x^{4} + 5 \, x^{2} - 2 \, \sqrt {3} {\left (x^{3} + x\right )} - {\left (2 \, x^{3} - \sqrt {3} {\left (2 \, x^{2} + 1\right )} + 4 \, x\right )} \sqrt {x^{2} + 1} + 2} {\left (x + \sqrt {x^{2} + 1}\right )} - \sqrt {3} - 2 \, \sqrt {x^{2} + 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [A] time = 0.65, size = 80, normalized size = 0.75 \begin {gather*} -\frac {1}{4} \, \sqrt {3} \log \left (x^{2} + \sqrt {3} \sqrt {x^{2} + 1} + 2\right ) + \frac {1}{4} \, \sqrt {3} \log \left (x^{2} - \sqrt {3} \sqrt {x^{2} + 1} + 2\right ) + \frac {1}{2} \, \arctan \left (\sqrt {3} + 2 \, \sqrt {x^{2} + 1}\right ) + \frac {1}{2} \, \arctan \left (-\sqrt {3} + 2 \, \sqrt {x^{2} + 1}\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.03, size = 296, normalized size = 2.79 \begin {gather*} -\frac {\sqrt {2}\, \sqrt {\frac {2 \left (x +1\right )^{2}}{\left (-x +1\right )^{2}}+2}\, \left (\sqrt {3}\, \arctanh \left (\frac {\sqrt {\frac {2 \left (x +1\right )^{2}}{\left (-x +1\right )^{2}}+2}\, \sqrt {3}}{2}\right )+\arctan \left (\frac {\sqrt {\frac {2 \left (x +1\right )^{2}}{\left (-x +1\right )^{2}}+2}\, \left (x +1\right )}{\left (\frac {\left (x +1\right )^{2}}{\left (-x +1\right )^{2}}+1\right ) \left (-x +1\right )}\right )\right )}{4 \sqrt {\frac {\frac {\left (x +1\right )^{2}}{\left (-x +1\right )^{2}}+1}{\left (\frac {x +1}{-x +1}+1\right )^{2}}}\, \left (\frac {x +1}{-x +1}+1\right )}-\frac {\sqrt {2}\, \sqrt {\frac {2 \left (x -1\right )^{2}}{\left (-x -1\right )^{2}}+2}\, \left (\sqrt {3}\, \arctanh \left (\frac {\sqrt {\frac {2 \left (x -1\right )^{2}}{\left (-x -1\right )^{2}}+2}\, \sqrt {3}}{2}\right )+\arctan \left (\frac {\sqrt {\frac {2 \left (x -1\right )^{2}}{\left (-x -1\right )^{2}}+2}\, \left (x -1\right )}{\left (\frac {\left (x -1\right )^{2}}{\left (-x -1\right )^{2}}+1\right ) \left (-x -1\right )}\right )\right )}{4 \sqrt {\frac {\frac {\left (x -1\right )^{2}}{\left (-x -1\right )^{2}}+1}{\left (\frac {x -1}{-x -1}+1\right )^{2}}}\, \left (\frac {x -1}{-x -1}+1\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {{\left (2 \, x^{2} + 1\right )} x}{{\left (x^{4} + x^{2} + 1\right )} \sqrt {x^{2} + 1}}\,{d x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 1.85, size = 397, normalized size = 3.75 \begin {gather*} \frac {\left (\ln \left (x-\frac {1}{2}-\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )-\ln \left (\frac {x}{2}+\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )\,\sqrt {x^2+1}+1+\frac {\sqrt {3}\,x\,1{}\mathrm {i}}{2}\right )\right )\,\left (2\,{\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3+\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}{\sqrt {{\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^2+1}\,\left (4\,{\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3+1+\sqrt {3}\,1{}\mathrm {i}\right )}+\frac {\left (\ln \left (x+\frac {1}{2}-\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )-\ln \left (1+\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )\,\sqrt {x^2+1}-\frac {x}{2}+\frac {\sqrt {3}\,x\,1{}\mathrm {i}}{2}\right )\right )\,\left (2\,{\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}{\sqrt {{\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^2+1}\,\left (4\,{\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3-1+\sqrt {3}\,1{}\mathrm {i}\right )}+\frac {\left (\ln \left (x-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )-\ln \left (\frac {x}{2}+\left (\frac {\sqrt {3}}{2}-\frac {1}{2}{}\mathrm {i}\right )\,\sqrt {x^2+1}+1-\frac {\sqrt {3}\,x\,1{}\mathrm {i}}{2}\right )\right )\,\left (2\,{\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}{\sqrt {{\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^2+1}\,\left (4\,{\left (-\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3-1+\sqrt {3}\,1{}\mathrm {i}\right )}+\frac {\left (\ln \left (x+\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )-\ln \left (1+\left (\frac {\sqrt {3}}{2}+\frac {1}{2}{}\mathrm {i}\right )\,\sqrt {x^2+1}-\frac {x}{2}-\frac {\sqrt {3}\,x\,1{}\mathrm {i}}{2}\right )\right )\,\left (2\,{\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3+\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}{\sqrt {{\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^2+1}\,\left (4\,{\left (\frac {1}{2}+\frac {\sqrt {3}\,1{}\mathrm {i}}{2}\right )}^3+1+\sqrt {3}\,1{}\mathrm {i}\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {x \left (2 x^{2} + 1\right )}{\sqrt {x^{2} + 1} \left (x^{2} - x + 1\right ) \left (x^{2} + x + 1\right )}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________